#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 10;
int mp[N][N];
bool vis[N][N];
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int n, m, t, sx, sy, fx, fy;
ll ans;

void dfs(int x, int y) {
	if (x<1 || x>n || y<1 || y>m) return;
	if (x == fx && y == fy) {
		ans++;
		return;
	}
	for (int i = 0; i < 4; i++) {
		int xx = x + dx[i], yy = y + dy[i];
		if (!mp[xx][yy] && !vis[xx][yy]) {
			vis[x][y] = 1;
			dfs(xx, yy);
			vis[x][y] = 0;
		}
	}
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n >> m >> t;
	cin >> sx >> sy >> fx >> fy;
	while (t--) {
		int x, y; cin >> x >> y;
		mp[x][y] = 1;
	}
	mp[sx][sy] = 1;
	dfs(sx, sy);
	cout << ans << '\n';
	return 0;
}